<?php

/*
 * 微信扫码授权登录
 */
require_once(dirname(__FILE__).'/../include/config.inc.php');
require_once(dirname(__FILE__).'/../include/mysqli.class.php');
session_start();
if(empty($_SESSION['adminMerchant'])){
    $user=new wxApi($globalConfig['wx']);
    $unionid=$user->getUserInfo();
    //绑定了unionid的商户  并且行业类目是 外卖
    $merchantInfo = $dosql->GetOne('select * from dyspw_member where unionid = "'.$unionid.'" and is_vip = 3 and sort = 92');
    if(!$merchantInfo){
        echo '<script>alert("您当前无权限登录");setTimeout(function() {window.location.href="/xiaochengxu/merchant/order.php"},1000)</script>';
        exit();
    };
    $_SESSION['adminMerchant']=$merchantInfo;
}
header("Location: /xiaochengxu/merchant/order.php");
?>
